package com.action.admin;

import java.util.ArrayList;
import java.util.List;

import com.common.ListProcess;
import com.db.admin.AdminDAO;
import com.db.admin.AdminLogInfoVO;
import com.db.admin.LoginfoVO;
import com.db.organization.DeptVO;


public class AdminLogSerchAction {
	private int curpage = 1;
	private int totalpage = 1;
	private int lpp = 10;
	
	private AdminDAO adminDAO;
	private ListProcess listProc;
	private int deptno;
	private List<Object> list = new ArrayList<Object>();
	private List<DeptVO> dlist;

	public List<DeptVO> getDlist() {
		return dlist;
	}
	public int getCurpage() {
		return curpage;
	}
	public void setCurpage(int curpage) {
		this.curpage = curpage;
	}
	public int getTotalpage() {
		return totalpage;
	}
	public List<Object> getList() {
		return list;
	}
	
	public void setListProc(ListProcess listProc) {
		this.listProc = listProc;
	}
	public void setAdminDAO(AdminDAO adminDAO) {
		this.adminDAO = adminDAO;
	}
	public void setDeptno(int deptno) {
		this.deptno = deptno;
	}
	public int getDeptno() {
		return deptno;
	}
	public String execute() throws Exception {
		//System.out.println(deptno);		
		list = adminDAO.lgSerchDept(deptno);
		dlist = adminDAO.DeptList();
		totalpage = listProc.getTotalPage(list, lpp);
		list = listProc.createPage(curpage, lpp, totalpage, list);
		//System.out.println(list.toString());
		return "success";
	}
	
}
